package com.niiwoo.civet.trade.service.dubbo.creditor;

import com.alibaba.dubbo.config.annotation.Service;
import com.niiwoo.civet.trade.dao.entity.CreditorTransferConfirmOrderDetail;
import com.niiwoo.civet.trade.dao.entity.CreditorTransferConfirmOrderDetailBiz;
import com.niiwoo.civet.trade.dto.common.BathTransactionNotifyDTO;
import com.niiwoo.civet.trade.dto.response.creditor.CreditorTransferConfirmOrderDetailBizDTO;
import com.niiwoo.civet.trade.dto.response.creditor.CreditorTransferConfirmOrderDetailDTO;
import com.niiwoo.civet.trade.service.creditor.CreditorTransferConfirmDubboService;
import com.niiwoo.civet.trade.service.local.creditor.CreditorTransferConfirmLocalService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 债转确认
 *
 * @author liaojunjun
 */
@Service(version = "1.0.0")
public class CreditorTransferConfirmDubboServiceImpl implements CreditorTransferConfirmDubboService {

    @Autowired
    private CreditorTransferConfirmLocalService creditorTransferConfirmLocalService;

    /**
     * 债转确认结果通知
     */
    public void creditorTransferConfirmResultNotify(List<BathTransactionNotifyDTO> creditorTransferConfirmNotifyDTOList){
        creditorTransferConfirmLocalService.creditorTransferConfirmResultNotify(creditorTransferConfirmNotifyDTOList);
    }

    /**
     * 银行债转确认结果查询
     */
    public void bankCreditorTransferConfirmResultQueryJob(){
        creditorTransferConfirmLocalService.bankCreditorTransferConfirmResultQueryJob();
    }

    /**
     * 银行债转确认失败任务
     */
    public void bankCreditorTransferConfirmFailedJob(){
        creditorTransferConfirmLocalService.bankCreditorTransferConfirmFailedJob();
    }

    /**
     * 记账任务
     */
    public void accountingStatusJob(){
        creditorTransferConfirmLocalService.accountingStatusJob();
    }

    /**
     * 债转出让人投资红包处理任务
     */
    public void sellerInvestPrizeStatusJob(){
        creditorTransferConfirmLocalService.sellerInvestPrizeStatusJob();
    }

    /**
     * 债权出让人标的加息处理任务
     */
    public void sellerProjectActivityRaiseInterestStatusJob(){
        creditorTransferConfirmLocalService.sellerProjectActivityRaiseInterestStatusJob();
    }

    @Override
    public CreditorTransferConfirmOrderDetailDTO getConfirmOrderDetail(String requestNO) {
        CreditorTransferConfirmOrderDetailDTO creditorTransferConfirmOrderDetailDTO = new CreditorTransferConfirmOrderDetailDTO();
        CreditorTransferConfirmOrderDetail creditorTransferConfirmOrderDetail = creditorTransferConfirmLocalService.getCreditorTransferConfirmOrderDetail(requestNO);
        BeanUtils.copyProperties(creditorTransferConfirmOrderDetail, creditorTransferConfirmOrderDetailDTO);
        return creditorTransferConfirmOrderDetailDTO;
    }

    @Override
    public CreditorTransferConfirmOrderDetailBizDTO getConfirmOrderDetailBiz(String requestNO, Byte bizType) {
        CreditorTransferConfirmOrderDetailBizDTO creditorTransferConfirmOrderDetailBizDTO = new CreditorTransferConfirmOrderDetailBizDTO();
        CreditorTransferConfirmOrderDetailBiz creditorTransferConfirmOrderDetailBiz = creditorTransferConfirmLocalService.getCreditorTransferConfirmOrderDetailBiz(requestNO,bizType);
        BeanUtils.copyProperties(creditorTransferConfirmOrderDetailBiz, creditorTransferConfirmOrderDetailBizDTO);
        return creditorTransferConfirmOrderDetailBizDTO;
    }

}
